package com.superhelper.common.domain;

public enum DeliverRecordStatus {
    unsend("未发单", 0), waiting("待接单", 1), picking("待取货", 2), delivering("配送中", 3), completed("已完成", 4), canceled("已取消",
            5), expired("已过期", 7), assigned("指派单", 8), abnormal("异常单", -1), unknown("未知状态", -100);
    private String desc;
    private int val;

    public String getDesc() {
        return desc;
    }

    public int getVal() {
        return val;
    }

    private DeliverRecordStatus(String desc, int val) {
        this.desc = desc;
        this.val = val;
    }

    public static DeliverRecordStatus valueOf(int status) {
        switch (status) {
        case 0:
            return unsend;
        case 1:
            return waiting;
        case 2:
            return picking;
        case 3:
            return delivering;
        case 4:
            return completed;
        case 5:
            return canceled;
        case 7:
            return expired;
        case 8:
            return assigned;
        case -1:
            return abnormal;
        default:
            return unknown;
        }
    }

}
